package me.firstapp.spi.bbs;

import java.util.Map;

import me.firstapp.common.json.ListObject;
import me.firstapp.common.json.PageObject;
import me.firstapp.common.json.SingleObject;
import me.firstapp.common.module.bbs.JsonTopic;
import me.firstapp.common.module.bbs.JsonTopicInManage;

public interface TopicService {

	/**
	 * 新增话题
	 * 
	 * @param memberId
	 *            用户id (必填)
	 * @param sectionId
	 *            板块id (必填)
	 * @param title
	 *            标题 (必填)
	 * @param summary
	 *            摘要(必填)
	 * @param content
	 *            内容
	 * @return
	 */
	SingleObject<JsonTopic> addTopic(Long memberId, Long sectionId, String title, String summary, String content);

	/**
	 * 分页获取全部话题
	 * 
	 * @param pageNo
	 *            页码(必填)
	 * @param pageSize
	 *            页容量(必填)
	 * @param sectionId
	 *            板块id(非必填)
	 */
	PageObject<JsonTopic> findTopicsPage(Integer pageNo, Integer pageSize, Long sectionId, Long memberId,
			Integer recommend, String sortParam, String sortType);

	/**
	 * 通过话题id查询话题
	 * 
	 * @param topicId
	 *            话题id(必填)
	 */
	SingleObject<JsonTopic> findTopic(Long topicId);

	/**
	 * 查询用户话题量
	 * 
	 * @param memberId
	 */
	SingleObject<Long> findMemberTopicsCounts(Long memberId);

	/**
	 * 获取一定数量的话题
	 * 
	 * @param memberId
	 *            用户id
	 * @param sectionId
	 *            板块id
	 * @param counts
	 *            数量（必传）
	 * @return
	 */
	ListObject<JsonTopic> findSomeTopics(Long memberId, Long sectionId, Integer counts);

	/**
	 * 调用分页查询话题接口
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	PageObject<JsonTopicInManage> findTopicsPageByParams(Integer pageNo, Integer pageSize,
			Map<String, Object> searchParams, String sortParam, String sortType, Long startTime, Long endTime);

	/**
	 * 调用删除话题接口
	 * 
	 * @param topicIds
	 * @return
	 */
	SingleObject<Object> deleteTopics(String topicIds);

	/**
	 * 调用更新话题接口
	 * 
	 * @param topicId
	 * @param summary
	 * @param content
	 * @param upCounts
	 * @param viewCounts
	 * @param replyCounts
	 * @param collectCounts
	 * @param recommend
	 * @return
	 */
	SingleObject<JsonTopic> updateTopic(Long topicId, String summary, String content, Long upCounts, Long viewCounts,
			Long replyCounts, Long collectCounts, Integer recommend);

	/**
	 * 调用更新话题接口
	 * 
	 * @param topicId
	 * @param summary
	 * @param content
	 * @param upCounts
	 * @param viewCounts
	 * @param replyCounts
	 * @param collectCounts
	 * @param recommend
	 * @param apiClientId
	 * @return
	 */
	SingleObject<JsonTopic> updateTopic(Long topicId, String summary, String content, Long upCounts, Long viewCounts,
			Long replyCounts, Long collectCounts, Integer recommend, Long apiClientId);

}
